import request from '@/utils/request'

// 出库强制终止
export function forcedTermination(data) {
  return request({
    url: '/imsWorkOrder/outOrder/forcedTermination',
    method: 'post',
    data,
  })
}

// 整出
export function getWholeOutStock(skuId) {
  return request({
    url: `/ims_data/imsStock/getWholeOutStock/${skuId}`,
    method: 'get',
  })
}

// 零出
export function getNotWholeOutStock(skuId) {
  return request({
    url: `/ims_data/imsStock/getNotWholeOutStock/${skuId}`,
    method: 'get',
  })
}

// 是否允许审核通过
export function isAllowAudit(outOrderId) {
  return request({
    url: `/imsWorkOrder/outOrder/isAllowAudit/${outOrderId}`,
    method: 'get',
  })
}

// 查询出库单管理列表
export function listOutOrder(query) {
  return request({
    url: '/imsWorkOrder/outOrder/list',
    method: 'get',
    params: query,
  })
}

// 查询出库单管理历史列表
export function listOutOrderHistory(query) {
  return request({
    url: '/imsWorkOrder/outOrder/list/history',
    method: 'get',
    params: query,
  })
}

// 查询出库单管理详细
export function getOutOrder(outOrderId) {
  return request({
    url: '/imsWorkOrder/outOrder/' + outOrderId,
    method: 'get',
  })
}

// 查询出库单历史详细
export function getOutOrderHistory(outOrderId) {
  return request({
    url: '/imsWorkOrder/outOrder/history/' + outOrderId,
    method: 'get',
  })
}

// 新增出库单管理
export function addOutOrder(data) {
  return request({
    url: '/imsWorkOrder/outOrder',
    method: 'post',
    data: data,
  })
}

// 修改出库单管理
export function updateOutOrder(data) {
  return request({
    url: '/imsWorkOrder/outOrder/status',
    method: 'put',
    data: data,
  })
}

// 删除出库单管理
export function delOutOrder(outOrderId) {
  return request({
    url: '/imsWorkOrder/outOrder/' + outOrderId,
    method: 'delete',
  })
}
